﻿<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>买车 - 锐车</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta content="锐车" name="keywords" />
	<meta content="锐车" name="description" />
	<link rel="stylesheet" href="/static/layui/css/layui.css">
	<link rel="stylesheet" type="text/css" href="/static/home/Css/style.css">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<script type="text/javascript" src="/static/home/Scripts/jquery.js"></script>
	<script type="text/javascript" src="/static/layui/layui.js"></script>
	<script type="text/javascript" src="/static/home/Scripts/common.js"></script>
	<script>
		layui.use(['layer'], function(){
			var layer = layui.layer;
		});
		layui.use('laypage', function(){
			var laypage = layui.laypage;
			laypage.render({
				elem: 'page'
				,count: 49
				,limit: 24
				,curr:1
				,jump: function(obj, first){
					//首次不执行
					if(!first){
						location.href = "/buycar/list-1oi"+obj.curr;
					}
				}
				,theme: '#FF6600'
				,prev: '<em>←</em>'
				,next: '<em>→</em>'
			});
		});
		layui.use('form', function(){
			var form = layui.form;
			form.on('select(transmission)', function(data){
				var transmission = $("select[name=transmission]").val();
				if(transmission!=0){
					window.location.href = "{:url('home/home/buycar')}?transmission="+transmission;
				}
			});
			form.on('select(gas)', function(data){
				var gas = $("select[name=gas]").val();
				if(gas!=0){
					window.location.href = "{:url('home/home/buycar')}?gas="+gas;
				}
			});
			form.on('select(emstandard)', function(data){
				var emstandard = $("select[name=emstandard]").val();
				var name = $(this).html()
				var obj = $(this);
				if(emstandard!=0){
					//console.log("{:url('home/home/buycar')}?emst="+emstandard);
					window.location.href = "{:url('home/home/buycar')}?emst="+emstandard;
					
				}
			});
		});
		$(function () {
			$brandmark_li = $("div.brandmark a");
			$brandmark_li.hover(function() {
				var index = $brandmark_li.index(this);
				$(this).addClass('selected').siblings().removeClass('selected');
				$("div.conditionlist > div").eq(index).show().siblings().hide();
			});
		});
		function aj(obj,url,key,val){
			$.ajax({
                type: 'POST',
                url: url,
                data:key+"="+val,
                success: function(data){
                   obj.css("display",'none');
                }
            });
		}
		
	</script>
  </head>
<body>
<!--内容-->
<script language="JavaScript">
$(function(){
	$(".nav_all_types").hover(function(){
		$(".show_all_types .layui-icon").html("&#xe619;");
		$(".all_types_box").show();
	},function(){
		$(".show_all_types .layui-icon").html("&#xe61a;");
		$(".all_types_box").hide();
	});

	//城市选择
	$(".citymark a").click(function() {
		var mark = $(this).attr("dataid");
		var citytop = $(".city-list").scrollTop()+$("#"+mark).position().top - 50;
		$(".city-list").animate({
			scrollTop: citytop
		}, {duration: 500, easing: "swing"});
		return false;
	});

	$(".selectcity").click(function(event) {
		if($(".citylist-box").is(":hidden")){
			$(this).addClass("whitebg");
			$(".selectcity .layui-icon").html("&#xe619;");
			$(".citylist-box").removeClass("layui-hide");
		}
		else{
			$(this).removeClass("whitebg");
			$(".selectcity .layui-icon").html("&#xe61a;");
			$(".citylist-box").addClass("layui-hide");
		}
		event.stopPropagation();//这句是必须
	});


	$(document).bind("click",function(e){
		var target  = $(e.target);
		if(target.closest(".citylist-box").length == 0){
			$('.selectcity').removeClass("whitebg");
			$(".selectcity .layui-icon").html("&#xe61a;");
			$(".citylist-box").addClass("layui-hide");
		}
		e.stopPropagation();
	});

	$(".changecity").click(function() {
		var city = $(this).attr("data");
		$.ajax({
			url: "/index.php?m=ajax&ajax=1&changecity=1",
			data:{city:city},
			type: "get",
			dataType: "json",
			success: function(data){
				if(data.status == 'y'){
					window.location.reload();
				}
			}
		});
	});
})
</script>
<!--头部-->
{include file="public/head"  title='首页'/}
<div class="layui-container layui-breadcrumb-nav">
	<span class="layui-breadcrumb">
	  <a href="/">首页</a>
	  <a><cite>买车</cite></a>
	</span>
</div>
<div class="layui-container">
	<div class="select-condition-box layui-clear">
		<span class="selected">已选</span>
		{if session('emst') != null}
		<a href="{:url('home/home/buycar')}?del=emst">{:session('emst')} <i class="layui-icon">&#x1006;</i></a>
		{/if}
		{if session('transmission') != null}
		<a href="{:url('home/home/buycar')}?del=transmission">{:session('transmission')} <i class="layui-icon">&#x1006;</i></a>
		{/if}
		{if session('bname') != null}
		<a href="{:url('home/home/buycar')}?del=bname">{:session('bname')} <i class="layui-icon">&#x1006;</i></a>
		{/if}
		{if session('lname') != null}
		<a href="{:url('home/home/buycar')}?del=lname">{:session('lname')} <i class="layui-icon">&#x1006;</i></a>
		{/if}
		{if session('gas') == 1}
		<a href="{:url('home/home/buycar')}?del=gas">1.0L 以下 <i class="layui-icon">&#x1006;</i></a>
		{elseif  session('gas') == 2}
		<a href="{:url('home/home/buycar')}?del=gas">1.0L-2.0L <i class="layui-icon">&#x1006;</i></a>
		{elseif  session('gas') == 3}
		<a href="{:url('home/home/buycar')}?del=gas">2.0L-2.5L <i class="layui-icon">&#x1006;</i></a>
		{elseif  session('gas') == 4}
		<a href="{:url('home/home/buycar')}?del=gas">2.5L-3.0L <i class="layui-icon">&#x1006;</i></a>
		{elseif  session('gas') == 5}
		<a href="{:url('home/home/buycar')}?del=gas">3.0L-4.0L <i class="layui-icon">&#x1006;</i></a>
		{elseif   session('gas') == 6}
		<a href="{:url('home/home/buycar')}?del=gas">4.0L 以上<i class="layui-icon">&#x1006;</i></a>
		{/if}
		{if session('preprice') == 3}
		<a href="{:url('home/home/buycar')}?del=preprice"><=3万<i class="layui-icon">&#x1006;</i>
		{elseif session('preprice') == 5}
		<a href="{:url('home/home/buycar')}?del=preprice"><=5万<i class="layui-icon">&#x1006;</i>
		{elseif session('preprice') == 10}
		<a href="{:url('home/home/buycar')}?del=preprice"><=10万<i class="layui-icon">&#x1006;</i>
		{elseif session('preprice') == 20}
		<a href="{:url('home/home/buycar')}?del=preprice"><=20万<i class="layui-icon">&#x1006;</i>
		{elseif session('preprice') == 30}
		<a href="{:url('home/home/buycar')}?del=preprice"><=30万<i class="layui-icon">&#x1006;</i>
		{elseif session('preprice') == ">30"}
		<a href="{:url('home/home/buycar')}?del=preprice">>30万<i class="layui-icon">&#x1006;</i>
		{/if}
		{if session('distance') == 1}
		<a href="{:url('home/home/buycar')}?del=distance"><=1万公里<i class="layui-icon">&#x1006;</i>
		{elseif session('distance') == 3}
		<a href="{:url('home/home/buycar')}?del=distance"><=3万公里<i class="layui-icon">&#x1006;</i>
		{elseif session('distance') == 5}
		<a href="{:url('home/home/buycar')}?del=distance"><=5万公里<i class="layui-icon">&#x1006;</i>
		{elseif session('distance') == 8}
		<a href="{:url('home/home/buycar')}?del=distance"><=8万公里<i class="layui-icon">&#x1006;</i>
		{elseif session('distance') == "9"}
		<a href="{:url('home/home/buycar')}?del=distance">>8万公里<i class="layui-icon">&#x1006;</i>
		{/if}
		<a href="{:url('home/home/buycar')}?del=all">重置 <i class="layui-icon">&#xe640;</i></a>
	</div>
</div>
<div class="layui-container">
	<div class="selected-box">
		<div class="condition-box layui-clear">
			<div class="title">品牌</div>
			<div id="brand" class="condition">
				<div class="brandmark">
					{foreach $bfirst as $k=>$v}
					<a href="javascript:;" 
					{if session('first')==$v['first']}
						class="selected"
					{elseif $k==0 && session('first')==null}
						class="selected"
					{/if}
					>{$v['first']}</a>
					{/foreach}
				</div>
				<div class="conditionlist">
					{foreach $bfirst as $k=>$v}
						<div id="{$v['first']}" class="layui-clear" 
						{if session('first')!=$v['first']}
							style="display: none;"
						{elseif $k!=0 && session('first')==null}
							style="display: none;"
						{/if}
						
						>
						{foreach $brand as $v1}
						{if $v1['first']==$v['first']}
							<a href="{:url('home/home/buycar')}?bname={$v1['bname']}" {if session('bname')==$v1['bname']}class="selected"{/if}>{$v1['bname']}</a>
						{/if}
						{/foreach}
						</div>
					{/foreach}
				</div>
			</div>
		</div>
		<div class="condition-box layui-clear">
			<div class="title">级别</div>
			<div class="condition">
				<p><a href="{:url('home/home/buycar')}?del=lname" {if session('lname')==null}class="selected"{/if}>不限</a></p>
				{foreach $level as $v}
				<p><a href="{:url('home/home/buycar')}?lname={$v['lname']}" 
					{if session('lname')==$v['lname']}
						class="selected"
					{/if}
					>{$v['lname']}</a></p>
				{/foreach}
			</div>
		</div>
		<div class="condition-box layui-clear">
			<div class="preprice">价格</div>
			<div class="condition">
				<p><a href="{:url('home/home/buycar')}?del=preprice" {if session('preprice')==null}class="selected"{/if}>不限</a></p>
				<p><a href="{:url('home/home/buycar')}?preprice=3" {if session('preprice')==3}class="selected"{/if}><=3万</a></p>
				<p><a href="{:url('home/home/buycar')}?preprice=5" {if session('preprice')==5}class="selected"{/if}><=5万</a></p>
				<p><a href="{:url('home/home/buycar')}?preprice=10" {if session('preprice')==10}class="selected"{/if}><=10万</a></p>
				<p><a href="{:url('home/home/buycar')}?preprice=20" {if session('preprice')==20}class="selected"{/if}><=20万</a></p>
				<p><a href="{:url('home/home/buycar')}?preprice=30" {if session('preprice')==30}class="selected"{/if}><=30万</a></p>
				<p><a href="{:url('home/home/buycar')}?preprice=>30" {if session('preprice')=='>30'}class="selected"{/if}>>30万</a></p>
			</div>
		</div>
		<div class="condition-box layui-clear">
			<div class="distance">里程</div>
			<div class="condition">
				<p><a href="{:url('home/home/buycar')}?del=distance" {if session('distance')==null}class="selected"{/if}>不限</a>
				<p><a href="{:url('home/home/buycar')}?distance=1" {if session('distance')==1}class="selected"{/if}>1万公里以下</a></p>
				<p><a href="{:url('home/home/buycar')}?distance=3" {if session('distance')==3}class="selected"{/if}>3万公里以下</a></p>
				<p><a href="{:url('home/home/buycar')}?distance=5" {if session('distance')==5}class="selected"{/if}>5万公里以下</a></p>
				<p><a href="{:url('home/home/buycar')}?distance=8" {if session('distance')==8}class="selected"{/if}>8万公里以下</a></p>
				<p><a href="{:url('home/home/buycar')}?distance=9" {if session('distance')==9}class="selected"{/if}>8万公里以上</a></p>
			</div>
		</div>
		<div class="condition-box layui-clear" style="padding-bottom:0">
			<div class="title">更多</div>
			<div class="condition">
				<form class="layui-form" action="">
					<div class="layui-row layui-col-space20">
						<div class="layui-col-md2">
							<select name="transmission" lay-filter="transmission">
								<option value="0">变速箱</option>
								<option value="自动" >自动</option>
								<option value="手动" >手动</option>
								<option value="手自一体" >手自一体</option>
							</select> 
						</div>
						<div class="layui-col-md2">
							<select name="gas" lay-filter="gas">
								<option value="0">排量</option>
								<option value="1" >1.0L以下</option>
								<option value="2" >1.0-2.0L</option>
								<option value="3" >2.0-2.5L</option>
								<option value="4" >2.5-3.0L</option>
								<option value="5" >3.0-4.0L</option>
								<option value="6" >4.0L以上</option>
							</select>
						</div>
						<div class="layui-col-md2">
							 <select name="emstandard" lay-filter="emstandard">
								<option value="0">排放标准</option>
								<option value="国I" >国一</option>
								<option value="国II" >国二</option>
								<option value="国III" >国三</option>
								<option value="国VI" >国四</option>
								<option value="国V" >国五</option>
							</select>
						</div>
					</div> 
				</form>
			</div>
		</div>
	</div>
</div>
<div class="layui-container mt20">
	<div class="car-tool-box layui-clear">
		<div class="carcounts">
			帮您找到 <span class="text-danger">{$num}</span> 条信息
		</div>
		<div class="orderby-box">
			<a href="/buycar/list-1ox2" >默认排序</a>
			<a href="/buycar/list-1ox4"> 价格 
				<span class="orderby"></span>
			</a>
			<a href="/buycar/list-1ox6"> 车龄 
				<span class="orderby"></span>
			</a>
		</div>
	</div>
</div>
<div class="layui-container mt20">
	<div class="layui-row layui-col-space30">
		{foreach $source as $v}
		<div class="layui-col-md3">
			<div class="carlist">
				<div class="img">
					<div class="isreport"></div>
					<a href="{:url('home/home/cardetail')}?sid={$v['sid']}" target="_blank"><img src="{$v['img']}" class="lazy"/></a>
				</div>
				<div class="caption">
					<a href="{:url('home/home/cardetail')}?sid={$v['sid']}" class="showmore">查看详情</a>
					<h4><a href="{:url('home/home/cardetail')}?sid={$v['sid']}" target="_blank">{$v['tname']}</a></h4>
					<p class="carinfo">{$v['licensetime']|date='Y-m-d'} 上牌 / {$v['distance']}万公里</p>
					<p class="carprice">{$v['preprice']}万</p>
					<p class="carinfo">新车指导价：<span class="hl">{$v['newprice']}万</span></p>
				</div>
			</div>
		</div>
		{/foreach}		
	</div>
	<div style="margin:10px auto 20px auto;text-align:right;">{$source|raw}</div>
</div>
{include file="public/foot"/}